package cn.edu.bjtu;

import cn.edu.bjtu.driver.DriverSupport;

/**
 * 用做命令行启动网络,进行训练或者恢复.
 * @author Alex
 *
 */
public class App {
	
	//java cn.edu.bjtu.App
	//cn.edu.bjtu.driver.LeAndMergeCnnNet -w2v /home/zhengze/Downloads/out/100_5.txt -train /home/zhengze/Documents/AlexData/train.txt -test /home/zhengze/Documents/AlexData/test.txt -target /home/zhengze/Documents/AlexData/cnn_le.bin -epoch 10
	//cn.edu.bjtu.driver.LeAndMergeCnnNet -w2v D:\textdata\mymodel\fdModel_100.txt -train /D:\textdata\mymodel\train.txt -test D:\textdata\mymodel\test.txt -target D:\textdata\mymodel\cnn_le.bin -epoch 100
	//cn.edu.bjtu.driver.FDCNNNet  -w2v D:\textdata\mymodel\fdModel_100.txt -train D:\\textdata\\word2vecmodel\\fddata_train -test D:\\textdata\\word2vecmodel\\fddata_test -target D:\textdata\mymodel\fdcnn_100_all_8_1.bin -epoch 100
	//cn.edu.bjtu.driver.FDCNNNet -restore -w2v /Users/alex/deep4jdata/mymodel/fdModel_100.txt -target /Users/alex/deep4jdata/mymodel/fdcnn_100_all_8_1.bin
	public static void main(String[] args) throws Exception{
		if(args.length == 0){
			throw new IllegalArgumentException("Specified the App Class to run");
		}
		String clzz = args[0];
		Class<DriverSupport> clz = (Class<DriverSupport>) App.class.getClassLoader().<DriverSupport>loadClass(clzz);
		DriverSupport driver = clz.newInstance();
		String argsRemain [] = new String[args.length-1];
		for(int i = 0;i<argsRemain.length;i++){
			argsRemain[i] = args[i+1];
		}
		driver.invoke(argsRemain);
	}
} 